package com.bwie.service.impl;

import com.bwie.common.domain.User;
import com.bwie.mapper.UserMapper;
import com.bwie.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @className: UserServiceImpl
 * @Description: TODO
 * @version: v1.８.0
 * @author: 李明
 * @date: 2025/10/22 9:50
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;


    /**
     * 根据用户名称和密码查询该用户是否存在
     * @param username
     */
    @Override
    public User getUserInfo(String username) {
        User user = userMapper.getUserInfo(username);
        return user;
    }

    /**
     * 根据手机号查询用户信息
     *
     * @param phone
     */
    @Override
    public User getUserByPhone(String phone) {
        User user = userMapper.getUserByPhone(phone);
        return user;
    }

    /**
     * 注册用户
     * @param user
     */
    @Override
    public void addUserInfo(User user) {
        userMapper.addUserInfo(user);
    }

}
